package problema010;

public class PrimeSum {

	public static void main(String[] args){
		System.out.println(sumaPrimos());
	}
	
	public static long sumaPrimos(){
		long suma = 0;
		for(int i = 2; i < 2000000; i++){
			if(esPrimo(i)) suma += i;
		}
		return suma;
	}
	
	
	public static boolean esPrimo(double num){
		double hasta = Math.sqrt(num);
		int hastaI = (int) hasta;
		for(int i = 2; i <= hastaI; i++){
			if(num % i == 0) return false;
		}
		return true;
	}
}
